$(function(){

  $("#sure_time--btn").click(function(){
    if($(".time-content ul li.on").length == 0){
      alert("请选择时间点");
      return false;
    }
    var _json = {
      'monthDay': $(".time--nav .swiper-slide.cur .month-day").text(),
      'time': $(".time-content ul li.on").text()
    }
    localStorage.setItem('timeInfo',JSON.stringify(_json));
    if(orderId == null){
        location.href = 'orderConfirm.html?serviceId='+serviceId+"&chargesType="+chargesType+"&months="+months+"&price="+price;
    }else{
    	var date = new Date();
    	var year = date.getFullYear();
    	var Day = _json.monthDay.split("/")
    	var time = year+"年"+Day[0]+"月"+Day[1]+"日"+" "+_json.time;
    	//var path = "LanJuPublic";
    	$.ajax({
    		url : "/LanJuPublic/service/insertAppointTime.do",
    		data : {
    			"orderId":orderId,
    			"start_serviceDate":time,
    			"status":0
    		},
    		type : "GET",
    		dataType : 'json',
    		cache : false,
    		success : function(ret){
    			if(ret.res == true){
    				location.href = "serviceList.html";
    			}
    		},
    		error: function(){
    			$$.toast("预约出错出错");
    		}
    	});
       // 

    }
  });

});